const express = require('express')
const route = express.Router();

const adminModel = require("../db/model/adminModel")
const isLoginMiddle = require("../middleware/isLoginMiddle");

route.get("/adminList",isLoginMiddle, async (req, res) => {
  try {
    //对数据库进行查询
    const adminListRe = await adminModel.find({},{passWord : 0});
    res.send({
      code:10000,
      message:"查询成功",
      data:adminListRe
    })
    // console.log('adminListRe',adminListRe)
  } catch (e) {
    res.send({
      code: 10001,
      message: e.message,
      data:null
    })
  }
})
module.exports = route;